#ifndef __FLATPAKCREATEUSB__H__
#define __FLATPAKCREATEUSB__H__

#include "FlatpakBase.h"

#include <QFileInfo>
class Flatpak::CreateUsb : public Flatpak::Base {
    public:
        initCommand(CreateUsb, "create-usb");

        CreateUsb(const CreateUsb &) = default;
        CreateUsb(CreateUsb &&) = default;
        CreateUsb &operator=(const CreateUsb &) = default;
        CreateUsb &operator=(CreateUsb &&) = default;


        // --arch=
        Archs(CreateUsb)

        // --user/--system
        UserSystem(CreateUsb)

        // --runtime/--app
        RuntimeApp(CreateUsb)

        // --ostree-verbose
        OstreeVerbose(CreateUsb)

        CreateUsb setMountPath(QString mount_path) {
            if (QFileInfo(mount_path).isDir())
                m_mountPath = mount_path;
            return *this;
        }

        QString run() {
            Base::run();

            if (!m_mountPath.isEmpty() && QFileInfo(m_mountPath).isDir()) {
                args << m_mountPath;
            }

            return FlatpakCommand::RunCommand(command, args);
        }

    private:
        QString m_mountPath;
};

#endif  //!__FLATPAKCREATEUSB__H__

/****************************************************************
Usage:
  flatpak create-usb [OPTION…] MOUNT-PATH [REF…] - Copy apps or runtimes onto removable media

Help Options:
  -h, --help                  Show help options

Application Options:
  --user                      Work on the user installation
  --system                    Work on the system-wide installation (default)
  --installation=NAME         Work on a non-default system-wide installation
  --app                       Look for app with the specified name
  --arch=ARCH                 Arch to copy
  --destination-repo=DEST     Use custom repository directory within the mount
  --runtime                   Look for runtime with the specified name
  --allow-partial             Allow partial commits in the created repo
  -v, --verbose               Show debug information, -vv for more detail
  --ostree-verbose            Show OSTree debug information
****************************************************************/

